package com.chinasoft.movies.mapper;

import com.chinasoft.movies.pojo.Top50Movies;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface Top50MoviesMapper {

    //分页查询方法
    @Select("select title,revenue,popularity,director from movies_top50_by_revenue order by revenue desc limit #{offset}, #{pageSize}")
    List<Top50Movies> queryTop50MoviesByPage(@Param("offset") int offset, @Param("pageSize") int pageSize);

    //获取总数的方法
    @Select("select count(*) from movies_top50_by_revenue")
    int countTop50Movies();
}
